package com.ds.extend.aware;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class ApplicationContextAwareTest implements ApplicationContextAware { 
	
	ApplicationContext applicationContext ; 
	
	/**
     * 容器启动的时候会调用这个方法，只需要将applicationContext设置即可
     * @param applicationContext 容器启动会自动注入
     * @throws BeansException
     */
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext ;
    }

}
